<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      lang="zh-CN"
      xmlns:th="http://www.thymeleaf.org"
      xmlns="http://www.w3.org/1999/xhtml" layout:decorate="~{layout/template}">
<head>
    <title>栏目管理</title>
    <link rel="stylesheet" href="/css/cms/channel/list.css"/>
</head>
<body>
<div id="contentContainer" layout:fragment="content" class="contentContainer" v-cloak>

    <el-row id="toolbar">
        <el-col :span="12">
            <div class="pull-left">
                <el-input v-model="channelName" @keyup.enter.native="onSearch" class="searchBox"
                          placeholder="请输入栏目名称"></el-input>
                <el-button type="primary" @click.native="onSearch">
                    <i class="fa fa-search"></i>
                    <span>查询</span>
                </el-button>
            </div>
        </el-col>
        <el-col :span="12">
            <div class="pull-right">
                <el-button-group>
                    <el-button th:if="${addFunc!=null}" @click.native="onAdd">
                        <i th:class="${addFunc.iconClass}"></i>
                        <span th:text="${addFunc.name}"></span>
                    </el-button>
                    <el-button th:if="${editFunc!=null}" @click.native="onEdit">
                        <i th:class="${editFunc.iconClass}"></i>
                        <span th:text="${editFunc.name}"></span>
                    </el-button>
                    <el-button th:if="${deleteFunc!=null}" @click.native="onDelete">
                        <i th:class="${deleteFunc.iconClass}"></i>
                        <span th:text="${deleteFunc.name}"></span>
                    </el-button>
                </el-button-group>
            </div>
        </el-col>
    </el-row>
    <el-row>
        <el-col :span="5">
            <div class="tree-layout">
                <div class="tree">
                    <el-tree
                            ref="tree"
                            node-key="id"
                            :default-expanded-keys="[0]"
                            @node-click="onTreeNodeClick"
                            :indent="16"
                            :data="treeData"
                            :props="treeProps">
                    </el-tree>
                </div>
            </div>
        </el-col>
        <el-col :span="19">
            <el-row>
                <el-table
                        ref="multipleTable"
                        tooltip-effect="light"
                        class="dataTable"
                        :data="tableData"
                        :height="tableHeight"
                        @selection-change="onSelectionChange">
                    <el-table-column
                            type="selection"
                            width="50">
                    </el-table-column>
                    <el-table-column
                            prop="channelId"
                            label="栏目ID"
                            width="80">
                    </el-table-column>
                    <el-table-column
                            prop="channelName"
                            label="栏目名称">
                    </el-table-column>
                    <el-table-column
                            prop="parentChannelName"
                            label="父栏目名称">
                    </el-table-column>
                    <el-table-column
                            prop="channelPath"
                            label="栏目路径"
                            width="140">
                    </el-table-column>
                    <el-table-column
                            prop="priority"
                            label="排序"
                            align="center"
                            width="80">
                    </el-table-column>
                </el-table>
            </el-row>

            <el-row id="pagination">
                <div class="pull-right">
                    <el-pagination
                            layout="total, sizes, prev, pager, next, jumper"
                            :current-page="pageNum"
                            :page-size="pageSize"
                            :page-sizes="pageSizes"
                            :total="total"
                            @size-change="onSizeChange"
                            @current-change="onCurrentChange">
                    </el-pagination>
                </div>
            </el-row>
        </el-col>
    </el-row>

</div>

<th:block layout:fragment="staticFile">
    <script src="/plugins/jQuery-slimScroll-1.3.8/jquery.slimscroll.min.js"></script>
    <script src="/js/cms/channel/list.js"></script>
</th:block>

</body>
</html>